<%@page import="java.util.ArrayList"%>
<%@page import="POJO.ChiTietPhieuDatHang"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@page import="POJO.NguoiDung"%>
<%
    String err = (String) session.getAttribute("id");
    if (err == "1")
    {
        // da dang nhap
        // Lấy loại người dùng
        NguoiDung nguoiDung = (NguoiDung) session
                .getAttribute("nguoiDung");
        if (!(nguoiDung.getLoai() == 3 || nguoiDung.getLoai() == 4))
        {
            RequestDispatcher dispatcher = request
                    .getRequestDispatcher("/view/Permission.jsp");
            dispatcher.forward(request, response);
        }
    }
    else
    {
        response.sendRedirect("login");
    }

    ArrayList<ChiTietPhieuDatHang> list = (ArrayList<ChiTietPhieuDatHang>) request.getAttribute("chiTietPhieuDatHang");
    
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Thay đổi thông tin sản phẩm</title>
<link rel="stylesheet"
	href="http://localhost:8080/OnlineShop/css/style.css" type="text/css"
	media="all" />
</head>
<body>
	<!-- Header -->
	<div id="header"></div>
	<!-- End Header -->

	<!-- Container -->
	<div id="container">
		<div class="shell">

			<div id="main">
				<!-- Content -->
				<div id="content">

					<!-- Box -->
					<!-- End Box -->

					<!-- Box -->
					<div class="box">
						<!-- Box Head -->
						<div class="box-head">
							<h2>Chi tiết phiếu đặt hàng</h2>
						</div>
						<!-- End Box Head -->

						<form action="" method="post">

							<!-- Form -->
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
							  <tr>
							    <th scope="col"><h3>Mã chi tiết phiếu đặt</h3></th>
							    <th scope="col"><h3>Mã sản phẩm</h3></th>
							    <th scope="col"><h3>Số lượng</h3></th>
							    <th scope="col"><h3>Đơn giá</h3></th>
						      </tr>
						      <%
						      	for(ChiTietPhieuDatHang chiTietPhieuDatHang : list)
						      	{
						      %>
							  <tr>
							    <th scope="col"><%= chiTietPhieuDatHang.getMaChiTietPD() %></th>
							    <th scope="col"><%= chiTietPhieuDatHang.getMaSanPham() %></th>
							    <th scope="col"><%= chiTietPhieuDatHang.getSoLuong()%></th>
							    <th scope="col"><%= chiTietPhieuDatHang.getDonGia()%></th>
						      </tr>
						      <%
						      	}
						      %>
					      </table>
					      <p><a href="./index.jsp">Bach to homepage</a></p>
					      
<!-- End Form -->

							<!-- Form Buttons -->

							<!-- End Form Buttons -->
						</form>
					</div>
					<!-- End Box -->

				</div>
				<!-- End Content -->

				<!-- Sidebar -->
				<!-- End Sidebar -->

				<div class="cl">&nbsp;</div>
			</div>
			<!-- Main -->
		</div>
	</div>
	<!-- End Container -->

	<!-- Footer -->
<!-- 	<div id="footer"> -->
<!-- 		<div class="shell"> -->
<!-- 			<span class="left">&copy; 2010 - CompanyName</span> <span -->
<!-- 				class="right"> Design by <a href="http://chocotemplates.com" -->
<!-- 				target="_blank" title="The Sweetest CSS Templates WorldWide">Chocotemplates.com</a> -->
<!-- 			</span> -->
<!-- 		</div> -->
<!-- 	</div> -->
	<!-- End Footer -->

</body>
</html>